import request from '@/config/axios'

export interface CourseTestMachineVO {
  id: number
  workTaskNumber: string
  productName: string
  modelSpecification: string
  orderQuantity: number
  code: string
  partNumber: string
  partName: string
  drawingNumber: string
  partSpecification: string
  material: string
  specification: string
  planStartDate: localdate
  planEndDate: localdate
  netSizeLength: number
  netSizeWidth: number
  cuttingSizeLength: number
  cuttingSizeWidth: number
  planQuantity: number
  reportQuantity: number
  completeQuantity: number
  differenceQuantity: number
  productionTeam: string
  deviceName: string
  deviceCode: string
  operator: string
  jobNumber: string
  dictStatus: number
  processPrice: number
  creatorName: string
  productNumber: string
}

// 查询生产管理-过程管理-试机管理列表
export const getCourseTestMachinePage = async (params) => {
  return await request.get({ url: `/produce/course-test-machine/page`, params })
}

// 查询生产管理-过程管理-试机管理详情
export const getCourseTestMachine = async (id: number) => {
  return await request.get({ url: `/produce/course-test-machine/getDetail?id=` + id })
}

// 新增生产管理-过程管理-试机管理
export const createCourseTestMachine = async (data: CourseTestMachineVO) => {
  return await request.post({ url: `/produce/course-test-machine/create`, data })
}

// 修改生产管理-过程管理-试机管理
export const updateCourseTestMachine = async (data: CourseTestMachineVO) => {
  return await request.put({ url: `/produce/course-test-machine/update`, data })
}

// 删除生产管理-过程管理-试机管理
export const deleteCourseTestMachine = async (id: number) => {
  return await request.delete({ url: `/produce/course-test-machine/delete?id=` + id })
}

// 导出生产管理-过程管理-试机管理 Excel
export const exportCourseTestMachine = async (data) => {
  return await request.download({ url: `/produce/course-test-machine/export-excel`, data })
}

// 获取生产班组
export const getOrgTeamArchives = async (params) => {
  return await request.get({ url: `/config/org-team-archives/list-all-simple`, params })
}

// 指派保存生产管理-过程管理-试机管理
export const assignCourseTestMachine = async (data: CourseTestMachineVO) => {
  return await request.put({ url: `/produce/course-test-machine/assignTask`, data })
}
